import http from './http'

// 设备管理API
export const equipmentApi = {
  // 分页查询设备（关联用户表）
  getEquipmentPage(params) {
    return http({
      url: '/database/equipment/page',
      method: 'get',
      params
    })
  },

  // 根据ID查询设备（关联用户表）
  getEquipmentById(id) {
    return http({
      url: `/database/equipment/${id}`,
      method: 'get'
    })
  },

  // 添加设备（设备编号自动生成）
  addEquipment(data) {
    return http({
      url: '/database/equipment/add',
      method: 'post',
      data
    })
  },

  // 修改设备
  updateEquipment(data) {
    return http({
      url: '/database/equipment/update',
      method: 'put',
      data
    })
  },

  // 删除设备
  deleteEquipmentById(id) {
    return http({
      url: `/database/equipment/${id}`,
      method: 'delete'
    })
  }
} 